package com.itheima.dubbo.interfaces;

import com.itheima.commons.pojo.Comment;
import com.itheima.commons.vo.PageResult;
import org.bson.types.ObjectId;
import org.springframework.data.domain.PageRequest;

import java.util.List;

public interface CommentApi {

    //点赞和喜欢都调用这个
    Long comment(Comment comment,Integer type,Class t);

    //取消点赞和喜欢都调用这个
    Long disComment(Long userId, ObjectId publishId, Integer type,Class t);

    //查询点赞和喜欢数都调用这个
    Long queryComment(ObjectId publishId,Integer type,Class t);

    //查询点赞和喜欢状态都调用这个
    boolean queryCommentStatus(ObjectId publishId,Integer type,Long userId,Class t);

    //查询评论列表
    PageResult queryCommentList(ObjectId publishId, Integer page, Integer pageSize,Class t);

    //查询评论数量
    Long queryCommentCount(ObjectId publishId);

    //发表评论
    Long saveComment(Comment comment);

    //通过主键id查询
    Comment queryComment(ObjectId _id);


    List<Comment> queryCommentListByUserId(Integer page, Integer pageSize, Long userId, int commentType);
}
